package testrj.runner.asserter;

import rjson.Rjson;
import rjson.printer.Printer;
import rjson.transformer.AbstractTransformer;

public class AsJsonWithoutDateAsserter extends EqualsAsserter {
	public void assertEquals(Object expected, Object actual) {
		Rjson rjsonWithoutDate = Rjson.newInstance().with(new DateTransformer()).andIgnoreModifiers();
		String expectedJson = rjsonWithoutDate.toJson(expected);
		String actualJson = rjsonWithoutDate.toJson(actual);
		super.assertEquals(expectedJson, actualJson);
	}
}

class DateTransformer extends AbstractTransformer {
	public boolean canHandle(Object object) {
		if (object instanceof java.util.Date)
			return true;
		return false;
	}

	public void transform(Object object, Printer printer, Rjson rjson) {
		printData(null, printer);
	}
}